<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setCharacterEncoding("utf-8");
%>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title><s:property value="title"/></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">   
	
	<link href="css/bbs.css" rel="stylesheet" type="text/css"/> 
	<script type='text/javascript' src='/sjzl/dwr/interface/CheckTextNull.js'></script>
	<script type='text/javascript' src='/sjzl/dwr/interface/UploadMonitor.js'></script>
	<script type='text/javascript' src='/sjzl/dwr/engine.js'></script>
	<script type='text/javascript' src='/sjzl/js/util.js'></script>
	<script type="text/javascript" src="/sjzl/js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="js/upload.js"></script>
	<style type="text/css">
		.edit_div span{
			font-size: 12px;
		}
	</style>
	
	<script type="text/javascript">
		function check(word){
			document.getElementById("name1").value=word;				
		}
		function checkInputEdit() {
			var titleName=document.getElementById("post_create_post_name").value;//这里的post_create_post_name是标题的id值
			titleName=titleName.replace(/\s+/g,"");//去掉输入框前面的空格
			if(titleName.length==0){//判断
				art.dialog({
					lock: true,
    				content: '标题不能为空！'
				});
				return false;
			}
			var inputEditor=document.getElementById("inputEditor").value;	
			if(inputEditor=="false"){
				art.dialog({
					lock: true,
    				content: '要求输入的内容不能为空！'
				});
				return false;
			}return true;
			
		}
		function checkText() {
			var oEditor=FCKeditorAPI.GetInstance('input_edit');
			var OEditor="&nbsp;"+oEditor.GetXHTML(true);
			CheckTextNull.checkInputEdit(OEditor,function(data){
				document.getElementById("inputEditor").value=data;
			});
		}
	</script>

  </head>
  
  <body>
    <s:include value="/top.jsp"></s:include>
    
    	<div class="nav_div">
	    	<div style="width: 940px; margin: auto; position: relative;">
	    		<span>
	    			<s:a href="board_list">论坛首页</s:a>
	    			创建--${ board.name }--版块下的主题
	    		</span>
	    	</div>
	    </div>
    	
    	<br/><br/>
    	<div class="main_div">
    		<br/>
    			<div class="module_div">
    				<div style="width: 100%;  background-repeat: repeat-x;">
    					<div class="edit_div" >
    						<br/><br/>
    						<s:form action="post_create" method="post" enctype="multipart/form-data" name="myform">
    							<span style="font-size: 12px;">请选择--<span style="color: red;">${ board.name }</span>--下的子版块
    							<s:select id="name" name="boardname" list="boardList" listValue="name" headerKey="0" headerValue="--请选择子版块--" cssStyle="width: 130px; height: 20px;" 
    							onchange="check(document.myform.boardname.options[document.myform.boardname.selectedIndex].textContent)" />
    							标题：<s:textfield name="post.name" size="50" cssStyle="height: 20px;"></s:textfield>
    							<br/><span style="font-size: 12px; color: red;"><s:property value="message"/></span>
    							</span>
    							<br/>
						    	<FCK:editor instanceName="input_edit" inputName="post.content" height="300" width="100%" basePath="/fckeditor" toolbarSet="One">
									<jsp:attribute name="value"></jsp:attribute>
								</FCK:editor>
								<s:hidden value="" id="name1" name="boardName"></s:hidden>
								<s:hidden name="board_id" value="%{#request.board_id}"></s:hidden>
								<s:hidden id="inputEditor" value=""></s:hidden>
								<s:submit value="提  交" onmouseover="checkText()" onclick="return checkInputEdit()" cssStyle="width: 80px; height: 30px;"></s:submit>
								<a style="font-size: 13px; margin-left: 20px; cursor: pointer;" id="show">上传附件</a>
								<a style="font-size: 13px; margin-left: 20px; cursor: pointer;float:right; display: none;" id="hide">隐藏</a>
						    </s:form>
    					</div>
		    		</div>
    				
    			</div>
    		<br/>

    		<div id="showContext" style="width: 98%; border: 1px solid #696969; background-color:white; margin: auto; margin-bottom: 20px;display: none; ">
				  	<div style="margin: 20px;">
						<form name="uploadForm" method="post" action='FileUploadServlet' enctype="multipart/form-data" onsubmit="startProgress()" target="upload_frame">
							<div class="formDiv">
								<img src="images/atta.gif"/>
								<div id="uploadedFiles">
								</div>
								<div>	
									文件1：<s:file name="file1" id="file1" cssStyle=" height: 20px;"></s:file>
				    			    <input id="button" type="button" value="上传更多" style="width: 70px; height: 20px;" />
									<div id="more"></div><br/>
								</div>
							    <div id="progressBar" style="display: none; padding-top: 5px;">
						           	<div id="theMeter">
						               	<div id="progressBarText"></div>
										<div id="progressBarBox" style="width: 350px; height: 20px; border: 1px inset; background: #eee;">
						                   	<div id="progressBarBoxContent" style="width: 3px; height: 20px; border-right: 2px solid #444; background: #9ACB34;"></div>
						               	</div>
						           	</div>
						       	</div>
						       	<div id="button">
						       		<s:submit value="上  传" cssStyle="width: 60px; height: 20px;" id="uploadbutton"></s:submit>
						       		<s:reset value="取消" cssStyle="width: 60px; height: 20px;"></s:reset>
						       	</div>
						       	<div id="info">
						       		<br/>
							       	<b style="color: red;">注 意: </b> 
							       	<br/>1. 单次上传总文件大小不得超过16MB。
							       	<br/>2. 一次最多可以同时上传5个文件。						       		
						       	</div>
						    </div>
					  	</form>
					</div>
					<div id="hiddenDiv" style="width: 100%">
						<iframe id='upload_frame' name='upload_frame' src='' style='display: none'></iframe>
					</div>
    		</div> 
    	</div>
    <s:include value="/bottom.jsp"></s:include>
    
    <script type="text/javascript">
  		art.dialog({
			title: '温馨提示',
			lock: true,
		    content: '要求选择的子版块栏最好不要为空，否则将不能顺利发表主题帖子',
		    yesFn: function(){}
		});
  	</script>
  </body>
  
</html>
